package com.fu.config;

import org.springframework.stereotype.Component;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

@Component
public class TokenCache {

    private Map<String, String> cache = new ConcurrentHashMap<>();

    public void put(String key, String value){
        cache.put(key, value);
    }

    public String get(String key){
        return cache.get(key);
    }

    public boolean exist(String key){
        return cache.containsKey(key);
    }

    public String remove(String key){
        return cache.remove(key);
    }
}
